﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using ChessWebService.DTO;
using ChessWebService.Models;

namespace ChessWebService.Controllers
{
    public class OpenIDController : ApiController
    {
        public TaiKhoan Get(string OpenID)
        {
            TaiKhoanDAO TaiKhoan = new TaiKhoanDAO();
            try
            {
                TaiKhoan tk= TaiKhoan.KiemTraTaiKhoanOpenID(OpenID);
                return tk;
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        public void Post([FromBody]TaiKhoan value)
        {
            TaiKhoanDAO TaiKhoanDAO = new TaiKhoanDAO();
            TaiKhoanDAO.ThemTaiKhoanOpenID(value);
        }
    }
}
